package com.archive.forum.mapper;

import com.archive.forum.model.Post;
import com.archive.forum.model.PostWithBLOBs;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface PostExtMapper {
    int incView(Post post);
    int incCommentCount(Post post);
    List<Post> selectByTag( Post post);
    List<PostWithBLOBs> searchByKeyword(@Param("keyword") String keyword,
                                        @Param("offset") int offset,
                                        @Param("size") int size);

    int countByKeyword(@Param("keyword") String keyword);

    int countByTag(String tag);

    List<PostWithBLOBs> searchByTag(@Param("tag") String tag,
                                    @Param("offset") int offset,
                                    @Param("size") int size);

    void updateLikeCount(Integer targetId, int count);

    Integer insertSelective(PostWithBLOBs post);
}